From accdf061d4bfd9686417c223000848034dd48dd3 Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Thu, 12 Apr 2007 10:27:05 -0500 Subject: [PATCH] [XEN][POWERPC] Fix xchg macro. Signed-off-by: Jerone Young Signed-off-by: Hollis Blanchard --- xen/include/asm-powerpc/system.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-powerpc/system.h b/xen/include/asm-powerpc/system.h index 7eb41c9325..c0f21c64d0 100644 --- a/xen/include/asm-powerpc/system.h +++ b/xen/include/asm-powerpc/system.h @@ -28,7 +28,11 @@ #include #include -#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr)))) +#define xchg(ptr,x) \ +({ \ + __typeof__(*(ptr)) _x_ = (x); \ + (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(*(ptr))); \ +}) static __inline__ unsigned long __xchg_u32(volatile int *m, unsigned long val) -- 2.30.2